package Homework1;

import java.util.Scanner;

public class Homework1_7 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int max = input.nextInt();
        int min = max;
        for (int i = 1; i < n; i++){
            int d = input.nextInt();
            max = Math.max(max,d);
            min = Math.min(min,d);
        }
        System.out.println("max=" + max);
        System.out.println("min=" + min);
    }
}
